<%@ page language="java" pageEncoding="UTF-8"%> 
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xn="http://www.xiaonei.com/2009/xnml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<%=basePath%>css/connect.css" type="text/css" media="all" />
		<script language="JavaScript" src="<%=basePath%>js/calendar.js"></script>
		<script language="JavaScript" src="<%=basePath%>js/base.js"></script>
		<title>游向彼岸</title>
	</head>
	<body id="splash" class="splash" onload="getMyPlan()">
		<div id="header">
			<img id="logo" class="logo" src="<%=basePath%>img/logo.png" alt="游向彼岸" title="回到首页" width="100" height="28" />
			<div class="guide">
				<c:if test="${host.xnuid > 0}">
				<xn:profile-pic uid="${host.xnuid}" size="square"  connect-logo="true"></xn:profile-pic>
				</c:if>
				<p>
					<span class="guide">你好，<em class="user-name">${host.name}</em>
				</p>
				<p>
					<c:choose>
						<c:when test="${host.xnuid == 0}">
							<a class="register" href="logout.do?logout=yes">退出</a>
							<xn:login-button size="small" background="white" autologoutlink="true" onlogin="window.location='home.do'"></xn:login-button>
						</c:when>
						<c:otherwise>
							<a href="#" onclick="XN.Connect.logout(function() { window.location='home.do' })">Logout of Xiaonei</a>
						</c:otherwise>
					</c:choose>
				</p>
			</div>
		</div>
		<div id="main">
			<div id="content" class="clearfix">
				<div class="plan">
						<img src="<%=basePath%>img/top-loginbox.png" />
						<input type="hidden" value="save" name="op" />
						<div class="tips" id="savePlanSucc" style="display:none">
							<p class="right">
								<img src="<%=basePath%>img/16_correct.png" />
								添加了一条信息
							</p>
						</div>
						<div class="myplan section">
							<p>
								<label>我的计划:</label>
								<input type="input" class="width200" name="content" id="plancontent" value="" />
							</p>
							<p>
								<label>计划实现时间:</label>
								<input type="input" name="date" id="date" onfocus="calendar(event);" class="width300" value="" />
							</p>
							<p>
								<label> &nbsp; </label>
								<input style="margin: 0;" type="image" src="<%=basePath%>img/btn-done.png" onclick="saveMyPlan();" />
							</p>
							<p><img src="http://static.ak.fbcdn.net/images/icons/favicon.gif" /><input type="checkbox" id="publish_to_xiaonei" checked /> Publish this run to Xiaonei</p>
						</div>
					<img src="<%=basePath%>img/bottom-loginbox.png" />
				</div>
				<div class="panel">
					<div class="recent-plan">
						<h2>
							近期计划
						</h2>
						<div id="myplan">
						</div>
					</div>
					<div class="friend-plan">
						<h2>
							好友计划
						</h2>
						<c:choose>
							<c:when test="${friendPlans!=null}">
								<c:forEach var="item" items="${friendPlans}">
								<div class="clearfix">
									<xn:profile-pic uid="${item.xnuid}" size="square"  connect-logo="true"></xn:profile-pic>
									<p>
										<a href="http://www.xiaonei.com/profile.do?id=${item.xnuid}" target="_blank">${item.name}</a>
									</p>
									<p>
										${item.content}
									</p>
									<p>
										<span class="time">${item.date}</span>
									</p>
								</div>
								</c:forEach>
							</c:when>
							<c:otherwise>
								<p>尚无好友记录</p>
							</c:otherwise>
						</c:choose>
					</div>
				</div>
			</div>
		</div>
<script type="text/javascript" src="http://static.connect.xiaonei.com/js/v1.0/FeatureLoader.jsp"></script>
<script type="text/javascript">
XN_RequireFeatures(["EXNML"], function()
{
  XN.Main.init("${apiKey}", "xd_receiver.html");
});
</script>
		<div id="footer" class="clearfix">
			<p class="slogan">
				让我们一起游向彼岸
			</p>
		</div>
	</body>
</html>
